LIB=../src
CFLAGS=-I ${LIB} -g
OBJECTS=${LIB}/lex.json_.o ${LIB}/json.tab.o ${LIB}/json_api.o ${LIB}/datastream.o
binaries: json2stream  stream2json randomjson
json2stream:json2stream.c lib
	gcc -o $@ ${CFLAGS} json2stream.c ${OBJECTS}
stream2json:stream2json.c lib
	gcc -o $@ ${CFLAGS} stream2json.c ${OBJECTS}
randomjson:randomjson.c lib
	gcc -o $@ ${CFLAGS} randomjson.c ${OBJECTS}

test:binaries
	./randomjson | ./json2stream | ./stream2json 

lib:
	(cd ${LIB}; make compile)
clean:
	rm -f *.o json2stream stream2json randomjson